﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetFrameworkExtensions
{
  public static class ServiceProviderExtensions
  {
    public static T GetService<T>(this IServiceProvider serviceProvider)
    {
      if (serviceProvider == null) return default(T);
      return (T)serviceProvider.GetService(typeof(T));
    }
  }

}
